package com.tr.rentcar.model.dao;

import java.sql.SQLException;
import java.util.Map;

import com.tr.rentcar.model.GlobalParamHandler;
import com.tr.rentcar.model.bean.Webset;
import com.tr.rentcar.model.jdbc.MySqlDb;
import com.tr.rentcar.model.jdbc.ResultHandler;

public class Websetdao implements ResultHandler<Websetdao>{
	private MySqlDb db=MySqlDb.getInstance();

	/**
	 * 增加一条记录
	 */
	public boolean save(String title,String key,String describe,String name,String introduce,String tel,String logo) throws SQLException{
		String sql="insert into foregrond_webset(fw_title,fw_key,fw_describe,fw_name,fw_introduce,fw_tel,fw_logo) values(?,?,?,?,?,?,?)";
		return db.executeUpdate(sql, new GlobalParamHandler(title,key,describe,name,introduce,tel,logo))>0;
	}
	
	private MySqlDb Db=MySqlDb.getInstance();
	@Override
	public Websetdao doHander(Map<String, Object> row) {
Webset webset=new Webset();
webset.setfWtitle(row.get("fw_title")+"");
webset.setfWkey(row.get("fw_key")+"");
webset.setfWdescribe(row.get("fw_describe")+"");
webset.setfWname(row.get("fw_name")+"");
webset.setfWintroduce(row.get("fw_introduce")+"");
webset.setfWtel(row.get("fw_tel")+"");
webset.setfWlogo(row.get("fw_logo")+"");
webset.setfWaddress(row.get("fw_address")+"");
return null;
	}

}
